// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import VueResource from "vue-resource"
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-default/index.css'
import 'bootstrap/dist/css/bootstrap.css'
Vue.use(VueResource);
Vue.use(ElementUI);

Vue.config.productionTip = false;

Vue.http.interceptors.push((req,next) => {
  next(resp => {
    if (resp.status == 403) {
      location.hash = "/login";
    } else if (resp.status != 200) {
      alert('请求数据错误');
    }
  })
});
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  template: '<App/>',
  components: { App }
});
